import os
import scrapy


class FirefoxSpider(scrapy.Spider):
    name = "firefox"

    def start_requests(self):
        urls = [
            'https://www.lagou.com/jobs/300010.html',
        ]
        for url in urls:
            yield scrapy.Request(url=url, callback=self.parse)

    def parse(self, response):
        bname = os.path.basename(response.url)
        with open(bname, 'w') as f:
            f.write(response.text)
